#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
int main(int argc, const char *argv[])
{
    int value;
    int fd;
    if ((fd = open("/dev/beeper_driver", O_RDWR)) < 0)
    {
        perror("open error");
        return -1;
    }
    value = 2000;
    while (1)
    {
        value = 0;
        write(fd, &value, sizeof(value));
        sleep(1);
        value = 2000;
        write(fd, &value, sizeof(value));
        sleep(1);
    }
    close(fd);

    return 0;
}